package org.oschina.zb.platform.localmsg.mq;

import org.oschina.zb.platform.localmsg.util.JsonAdapter;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QSender {

	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void send(String qName, QMessage qMessage) {

		String sMessge = JsonAdapter.object2string(qMessage);

		this.rabbitTemplate.convertAndSend(qName, sMessge);
	}

}